home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
36
/
vfos_dv.zip
/
VIO_BIOS.INC
< prev
next >
Wrap
Text File
|
1988-08-01
|
15KB
|
524 lines
;
; VFOS_IBM VFOSSIL driver by Bob Hartman (SysOp of 1:132/101).
; Copyright 1988 by Spark Software. ALL RIGHTS RESERVED.
;
VioGetMode proc far
Enter_Vio
Check_Handle 00
les di,[bp+8] ; get pointer to buffer
mov cx,es:[di] ; get length
push cs ; set up ds
pop ds
mov si,offset mode_info ; get pointer to mode buffer
cmp cx,es:[di] ; how does it stack up
jbe f00_100 ; it looks ok
mov cx,es:[di] ; get the other value
f00_100:
cmp cx,3 ; is it less than 3
jae f00_101 ; it is still good
mov ax,382 ; bad buffer size
jmp f00_out ; get out
f00_101:
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 00,6 ; get out
VioGetMode endp
VioSetMode proc far
mov ax,355
ret 6
VioSetMode endp
VioGetConfig proc far
Enter_Vio
Check_Handle 02
les di,[bp+8] ; get pointer to buffer
mov cx,es:[di] ; get length
push cs ; set up ds
pop ds
mov si,offset mode_info ; get pointer to mode buffer
cmp cx,es:[di] ; how does it stack up
jbe f02_100 ; it looks ok
mov cx,es:[di] ; get the other value
f02_100:
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 02,6 ; get out
VioGetConfig endp
VioWrtTTY proc far
Enter_Vio
Check_Handle 03
push cs
pop ds
mov ax,ansi_state ; get current ANSI mode
mov cx,[bp+8] ; get string length
lds dx,[bp+10] ; get pointer to string
or ax,ax ; are we in ANSI mode?
jz f03_100 ; no ANSI, do it the other way
mov ah,40h ; set up for a write call
mov bx,1 ; use stdout
int 21h ; go do it
jmp f03_ok ; get out
f03_100:
mov si,dx ; get the pointer to ds:si
f03_101:
lodsb ; get a byte
mov ah,0eh ; write TTY mode
mov bh,0 ; page number
int 10h ; go do it through the BIOS
loop f03_101 ; do another one
f03_ok:
mov ax,0 ; say it was all ok
Exit_Vio 03,8 ; get out
VioWrtTTY endp
VioGetANSI proc far
Enter_Vio
Check_Handle 04
push cs
pop ds
mov ax,ansi_state ; get current ansi state
les di,[bp+8] ; get pointer for where to put it
stosw ; mov it there
mov ax,0 ; all is ok
Exit_Vio 04,6 ; get out
VioGetANSI endp
VioSetANSI proc far
Enter_Vio
Check_Handle 05
lds si,[bp+8] ; get the pointer to the state
lodsw ; get the state
push cs
pop ds
mov ansi_state,ax ; save it away
mov ax,0 ; all ok
Exit_Vio 05,6 ; get out
VioSetANSI endp
VioGetCurPos proc far
Enter_Vio
Check_Handle 06
mov ah,3 ; get cursor position BIOS call
mov bh,0
int 10h ; actually get it
les di,[bp+8] ; get the pointer to the row
mov dh,al ; save row in al
xor ah,ah ; clear out ah
stosw ; store the row
les di,[bp+12] ; get the pointer to the column
mov dl,al ; get the column to al
stosw ; store the column
mov ax,0 ; all ok
Exit_Vio 06,10 ; get out
VioGetCurPos endp
VioSetCurPos proc far
Enter_Vio
Check_Handle 07
mov ah,2 ; BIOS call to set the cursor pos
mov bh,0
mov dh,byte ptr [bp+10] ; get the row
cmp dh,0 ; check to see it is ok
jae f07_100
mov ax,358 ; no good
jmp f07_out
f07_100:
cmp dh,24 ; check it again
jbe f07_101
mov ax,358 ; no good
jmp f07_out
f07_101:
mov dl,byte ptr [bp+8] ; get the column
cmp dl,0 ; check if it is ok
jae f07_102
mov ax,359 ; no good
jmp f07_out
f07_102:
cmp dl,79 ; check it again
jbe f07_103
mov ax,359 ; no good
jmp f07_out
f07_103:
int 10h ; do the BIOS call
mov ax,0 ; all ok
Exit_Vio 07,6 ; get out
VioSetCurPos endp
VioGetCurType proc far
Enter_Vio
Check_Handle 08
les di,[bp+8] ; get pointer to buffer
push cs ; set up ds
pop ds
mov si,offset curs_info ; get pointer to cursor info
mov cx,8 ; length of cursor info
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 08,6 ; get out
VioGetCurType endp
VioSetCurType proc far
Enter_Vio
Check_Handle 09
mov ax,cs
mov es,ax
mov ds,ax
lds si,[bp+8] ; get pointer to buffer
mov ch,byte ptr ds:[si] ; get column
mov cl,byte ptr ds:[si+2] ; get row
mov ax,ds:[si+6] ; get attribute
cmp ax,-1 ; is it off?
jne f09_100 ; no, so continue
mov ch,30h ; turn off cursor
mov ch,30h ; turn off cursor
f09_100:
mov ah,1
mov bh,0
int 10h ; use BIOS to set the position
mov di,offset curs_info ; get pointer to cursor info
lds si,[bp+8] ; get pointer to buffer
mov cx,8 ; length of cursor info
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 09,6 ; get out
VioSetCurType endp
VioScrollUp proc far
Enter_Vio
Check_Handle 10
Scroll_Stuff 10,6
mov ax,0
Exit_Vio 10,16 ; get out
VioScrollUp endp
VioScrollDn proc far
Enter_Vio
Check_Handle 11
Scroll_Stuff 11,7
mov ax,0
Exit_Vio 11,16 ; get out
VioScrollDn endp
VioReadCellStr proc far
Enter_Vio
Check_Handle 12
Do_Row_Col 12,10,8
mov ax,0b800h ; offset for color card
mov si,di ; get the address as source index
mov ds,ax ; ds:si is now set up
les di,[bp+14] ; get the pointer to count
mov cx,es:[di]; ; put count in cx
les di,[bp+18] ; get the pointer in es:di
cld
repnz movsb ; move the bytes
mov ax,0 ; successful return
Exit_Vio 12,14 ; get out
VioReadCellStr endp
VioReadCharStr proc far
Enter_Vio
Check_Handle 13
Do_Row_Col 13,10,8
mov ax,0b800h ; offset for color card
mov si,di ; get the address as source index
mov ds,ax ; ds:si is now set up
les di,[bp+14] ; get length pointer
mov cx,es:[di] ; get length
les di,[bp+18] ; get the pointer in es:di
f13_100:
movsb ; move a byte
inc di ; get past attribute
loop f13_100 ; do the next one
mov ax,0 ; successful return
Exit_Vio 13,14 ; get out
VioReadCharStr endp
VioWrtCellStr proc far
Enter_Vio
Check_Handle 14
Do_Row_Col 14,10,8
mov cx,[bp+12] ; get length
shr cx,1 ; divide by two (two byte cells)
lds si,[bp+14] ; get the pointer in ds:si
mov bh,0 ; display page
f14_100:
Locate_Cursor 14
lodsw ; get the cell into ax
mov bl,ah ; put the attribute into bh
mov ah,9 ; call to write cell
push cx ; save registers
push si
mov cx,1 ; write it once
int 10h ; do the interrupt
pop si ; restore registers
pop cx
loop f14_100 ; loop and do it again
mov ax,0 ; successful return
Exit_Vio 14,12 ; get out
VioWrtCellStr endp
VioWrtCharStr proc far
Enter_Vio
Check_Handle 15
Do_Row_Col 15,10,8
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
mov bh,0 ; display page
f15_100:
Locate_Cursor 15
lodsb ; get the char into al
mov ah,10 ; call to write char
push cx ; save registers
push si
mov cx,1 ; write it once
int 10h ; do the interrupt
pop si ; restore registers
pop cx
loop f15_100 ; loop and do it again
mov ax,0 ; successful return
Exit_Vio 15,12 ; get out
VioWrtCharStr endp
VioWrtCharStrAtt proc far
Enter_Vio
Check_Handle 16
Do_Row_Col 16,14,12
mov cx,[bp+16] ; get length
lds si,[bp+8] ; get the pointer in ds:si
lodsb ; get the attribute
mov bl,al ; save the attribute
lds si,[bp+18] ; get the pointer to chars
mov bh,0 ; display page
f16_100:
Locate_Cursor 16
lodsb ; get the character
mov ah,9 ; call to write cell
push cx ; save registers
push si
mov cx,1 ; write it once
int 10h ; do the interrupt
pop si ; restore registers
pop cx
loop f16_100 ; loop and do it again
mov ax,0 ; successful return
Exit_Vio 16,16 ; get out
VioWrtCharStrAtt endp
VioWrtNAttr proc far
Enter_Vio
Check_Handle 17
Do_Row_Col 17,10,8
mov ax,0b800h ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsb ; get the character attribute
f17_100:
inc di ; get past character byte
stosb ; save the attribute
loop f17_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 17,12 ; get out
VioWrtNAttr endp
VioWrtNCell proc far
Enter_Vio
Check_Handle 18
Do_Row_Col 18,10,8
mov cx,[bp+12] ; get length
shr cx,1 ; divide by two (two byte cells)
lds si,[bp+14] ; get the pointer in ds:si
mov bh,0 ; display page
Locate_Cursor 18
lodsw ; get the character cell in ax
mov bl,ah ; put the attribute into bh
mov ah,9 ; call to write cell
int 10h ; do the interrupt
mov ax,0 ; successful return
Exit_Vio 18,12 ; get out
VioWrtNCell endp
VioWrtNChar proc far
Enter_Vio
Check_Handle 19
Do_Row_Col 19,10,8
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
mov bh,0 ; display page
Locate_Cursor 19
lodsb ; get the character cell in Al
mov ah,10 ; call to write cell
int 10h ; do the interrupt
mov ax,0 ; successful return
Exit_Vio 19,12 ; get out
VioWrtNChar endp